package com.gitlab.lucky.common.dao.mapper;

import com.gitlab.lucky.common.dao.model.LuckyRecord;
import com.gitlab.lucky.common.mapper.AbstractMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface LuckyRecordMapper extends AbstractMapper<LuckyRecord> {
    @Select("select sum(lucky_money) from lucky_record where openId = #{openId} and platform = #{platform}")
    Double selectLuckyRecordMoneyByOpenId(@Param("openId") String openId, @Param("platform")Integer platform);

    @Select("SELECT count( 1 )  FROM weixin_gzh_integration_record WHERE platform = #{platform} AND type in (9,10,11)")
    Integer selectLuckyRecordCountByPlaform(@Param("platform") Integer platform);
}